package com.zhongxi.guoyuan.utils;

import android.app.Activity;
import android.view.View;
import android.widget.LinearLayout;

/**
 * Created by Administrator on 2017/4/5.
 */

public class ImageUtils {

    public static void setHeight(Activity context, float rate, View view){
        int width = context.getWindowManager().getDefaultDisplay().getWidth();  //屏幕宽度
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(width, (int)(width*rate));
        view.setLayoutParams(lp);
    }

}
